<template>
    <nav class="nav-box">
        <div class="nav-input">
            <input id="userInput" type="text" @blur="flag=false" @focus="flag=true">
        </div>
        <div v-show="flag" class="nav-btn">
            <span>搜索</span>
        </div>
    </nav>
</template>
<script>
    Vue.component("TopBar",{
        template:document.currentScript.ownerDocument.querySelector("template"),
        data(){
            return {
                flag:false
            }
        }
    });
</script>